/*
       _             __
  ____(_)__ _______ / /____ ____
 / __/ (_-</ __(_-</ __/ -_) __/
/_/ /_/___/\__/___/\__/\__/_/

Napster client for RISC OS
Copyright (C) 2000 Robert Dimond

Portions are based on gnap by Ryan Dahl.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

Bransley Cottage, Cleobury Mortimer, Kidderminster, WORCS. DY14 0BZ
England. robdimond@cwcom.net

*/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "OS:os.h"
#include "OS:wimp.h"
#include "OS:messagetrans.h"
#include "OS:wimpreadsysinfo.h"
#include "OS:font.h"
#include "OS:osgbpb.h"

#include "proto.h"
#include "library.h"



#define C_INCOMING 10
#define C_DOWNLOADS 20
#define ISIZE 1024*64

#define MESSAGE_DELAY 200

#define CONNECTWIN_OKICON 7
#define CONNECTWIN_PASSWD 3
#define CONNECTWIN_USERNM 1
#define CONNECTWIN_NEWUSR 4
#define CONNECTWIN_EMAIL 5
#define CONNECTWIN_COND 8
#define CONNECTWIN_CONB 9
#define CONNECTWIN_REMD 11
#define CONNECTWIN_ALTS 12
#define CONNECTWIN_ALTST 13

#define MESSAGEWIN_DISMISS 2
#define MESSAGEWIN_MESSAGE 1

#define SEARCHWIN_ARTIST 2
#define SEARCHWIN_TRACK 3
#define SEARCHWIN_MAXRES 4
#define SEARCHWIN_BRD 7
#define SEARCHWIN_LTD 11
#define SEARCHWIN_FRD 16
#define SEARCHWIN_BRC 8
#define SEARCHWIN_LTC 12
#define SEARCHWIN_FRC 17
#define SEARCHWIN_BRI 9
#define SEARCHWIN_LTI 13
#define SEARCHWIN_FRI 18
#define SEARCHWIN_LTM 14
#define SEARCHWIN_OK 19

#define GETWIN_FILE 0
#define GETWIN_USER 1
#define GETWIN_CANCEL 4
#define GETWIN_OK 3
#define GETWIN_PROGB 5
#define GETWIN_PROGN 6
#define GETWIN_BAR 7

#define INFOWIN_AUTHOR 2
#define INFOWIN_VERSION 3
#define INFOWIN_PURPOSE 1

#define MESSWIN_USER 1
#define MESSWIN_MESS 2
#define MESSWIN_SEND 3

#define AUTHOR "Robert Dimond (Drobe software)"
#define VERSION "1.15Beta2 (14th November 2000)"
#define PURPOSE "Client for Napster"

void connectedchange(int new);
void motd_addline(char * text);
void search_finish(void);
void get_closewin(int);
void search_updatebar(int);
void mess_openwindow(wimp_block * block);
void mess_closewindow(wimp_block * block);
void mess_nullevent(wimp_block * block);
void mess_usermessage(wimp_block * block);
void mess_mouseclick(wimp_block * block);
void mess_menuselect(wimp_block * block);
void mess_redrawwindow(wimp_block * block);
void mess_keypressed(wimp_block * block);

int error(os_error *);

void ui_alert(char * text);
void ui_messalert(char * token);
void ui_openconnectwin(void);
void ui_iconbaricon(void);
void ui_loadwindows(void);
void ui_loadsprites(void);
void ui_loadmessages(void);
void ui_setupmenus(void);
void ui_close(void);
void ui_connectok(void);
void ui_newuserclick(void);
void ui_altserverclick(void);
void ui_openconmenu(void);
void ui_opencon2menu(void);
void ui_updatecond(void);
void ui_opencommenu(wimp_i icon);

void motd_openwin(void);
void motd_redrawwin(wimp_block * block);
void motd_reset(void);
void motd_init(void);
void motd_drawblock(wimp_draw * area, int more, int xorigin, int yorigin);

void search_openwin(void);
void search_updatecond(void);
void search_ok(void);
void search_new(void);
void search_ungrey(void);
void search_update(search_result * result);
void search_redrawwin(wimp_block * block);
void search_drawblock(wimp_draw * area, int more, int xorigin, int yorigin);
void search_click(wimp_block * block);
void search_browse(int search_no);
void search_complete(mp3file * file);
void search_changetype(search_type new);
void search_downloadclick(int search_no);
char * search_trim(char * in, int len);
void search_getok(int tno);
void get_init(void);
void ui_storedetails(void);
void ui_loaddetails(void);
void message_send(int search_no);
void motd_addline_actual(char * text);












